// routes.js
import { useRoutes, Navigate } from 'react-router-dom';
import { AreaChartOutlined, AlertOutlined, FundOutlined, FileOutlined, DatabaseOutlined, ApiOutlined } from '@ant-design/icons';

import TracePage from '../pages/TracePage';
import MessageBoxPage from '../pages/MessageBoxPage';
import HeapPage from '../pages/HeapPage';
import FilePage from '../pages/FilePage';
import RegistryPage from '../pages/RegistryPage';
import SocketPage from '../pages/SocketPage';

//eslint-disable-next-line
export const routes = [
  {
    path: '/',
    element: <Navigate to='/trace' />,
  },
  {
    path: '/trace',
    element: <TracePage />,
    name: '追踪总计',
    type: 'trace',
    icon: <AreaChartOutlined />,
  },
  {
    path: '/messageBox',
    element: <MessageBoxPage />,
    name: '弹窗',
    type: 'messageBox',
    icon: <AlertOutlined />,
  },
  {
    path: '/heap',
    element: <HeapPage />,
    name: '堆',
    type: 'heap',
    icon: <FundOutlined />,
  },
  {
    path: '/file',
    element: <FilePage />,
    name: '文件',
    type: 'file',
    icon: <FileOutlined />,
  },
  {
    path: '/registry',
    element: <RegistryPage />,
    name: '注册表',
    type: 'registry',
    icon: <DatabaseOutlined />,
  },
  {
    path: '/socket',
    element: <SocketPage />,
    name: '套接字',
    type: 'socket',
    icon: <ApiOutlined />,
  },
];


const Router = () => {
  const element = useRoutes(routes);
  return element;
};

export default Router;